section.section
  header.section__header
    h3.section__h3 chapters
  div.section__content
    h4.section__h4 Description
    dl.section__dl
      dt.section__dt Type：
      dd.section__dd Object
    p Chapters 模块：独立的导航菜单模块；
    pre.section__pre
      code.section__code.
        // 仅展示 API 中对外公开的方法和属性
        class Chapters extends Base {
          constructor(options) {
            super()

            this.attrs = Chapters.DEFAULTS
            this.$el = null
            this.$title = null
            this.$main = null
            this.$list = null
            this.$placeholder = null
            this.$parentElement = null
            this.$scrollElement = null
            this.chapters = []
            this.closed = false
            this.active = 0
            this.offsetTop = 0
            this.$active = null
            this.timer = null
            this.playing = false

            // 省略其它逻辑...
          }

          isClosed() {
              return this.closed
          }

          isSticky() {
            const position = this.attr('position')
            return position === 'sticky'
          }

          isFixed() {
            const position = this.attr('position')
            return position === 'fixed'
          }

          isInside() {
            return this.isFixed() || this.isSticky()
          }

          isOutside() {
            return !this.isInside()
          }

          attr(prop, value) {
            // 省略其它逻辑...
            return this
          }

          render() {
            // 省略其它逻辑...
            return this
          }

          highlight(id) {
            // 省略其它逻辑...
            return this
          }

          sticky() {
            // 省略其它逻辑...
            return this
          }

          scrollTo(top, after) {
            // 省略其它逻辑...
            return this
          }

          show() {
            // 省略其它逻辑...
            return this
          }

          hide() {
            // 省略其它逻辑...
            return this
          }

          toggle() {
            // 省略其它逻辑...
            return this
          }

          destroy() {
            this.removeListeners()
            // 省略其它逻辑...
            return this
          }

          reload(options) {
            this.destroy().initialize(this.attr(options))
            return this
          }
        }

        Chapters.DEFAULTS = {
          parentElement: '',
          scrollElement: '',
          selector: '',
          active: 0,
          closed: false,
          showCode: true,
          position: 'relative',
          chapters: [],
          created: null,
          mounted: null,
          afterClosed: null,
          afterOpened: null,
          afterScroll: null,
          beforeDestroy: null,
          afterDestroy: null
        }

        export default Chapters
